<div class="mod mod-test-list">
    <div class="inner">
        <div class="hd">
            <!--<h3><?php __('Tests List'); ?></h3>-->
        </div>
        <div class="bd">
            <ul>
<?php
$index = 0;
foreach ($tests as $test) { ?>

                <li<?php echo $index++ % 2 == 0 ? '' : ' class="altrow"'; ?>>
                    <div class="complex">
                        <div class="side"><?php e($test['Test']['id']); ?></div>
                        <div class="main">
                            <p class="test-content"><?php e($test['Test']['test_content']); ?></p>
<?php
$typeid = $test['Test']['test_type'];
switch ($typeid) {
    case 1:
    case 2:
        e($this->element('answerList',
            array('answers' => $test['Test']['select_options'],
                'name' => 'test'.$test['Test']['id'],
                'multiple' => $typeid == 1 ? true : false)));
        break;
    default:
        break;
}
?>

                            <p class="test-poster"><?php echo $this->Html->link($test['User']['user_name'], array('controller'=>'users', 'action'=>'view', $test['User']['id']));?></p>
                        </div>
                    </div>
                </li>
<?php } ?>

            </ul>
        </div>
    </div>
</div>
</tbody>
</table>
